import request  from "@/utils/request.js";
const PREFIX= "/admin/permission"

export default {

    getPermissionList(){
        return request({
            url:`${PREFIX}/tree`,
            method:'get'
        })
    },
    /**
     * 添加权限信息
     */
    addPermission(dto){
        return request({
            url:`${PREFIX}/add`,
            method:'post',
            data:dto
        })
    },
    /**
     * 修改权限信息
     */
    updatePermission(dto){
        return request({
            url:`${PREFIX}/update`,
            method:'post',
            data:dto
        })
    },
    /**
     * 获取权限信息
     * @param permissionId
     */
    getPermissionInfo(permissionId){
        return request({
            url:`${PREFIX}/info/${permissionId}`,
            method:'get'
        })
    },
    deletePermission(permissionId){
        return request({
            url:`${PREFIX}/delete/${permissionId}`,
            method:'delete'
        })
    }
}